function Ajax(type,url,data,success){
	var xhr=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');

	if(type=='GET'){
		if(data){
			xhr.open('GET',url+'?'+data,true);//true表示异步加载
		}else{
			xhr.open('GET',url,true);
		}
		xhr.send();
	}else{
		xhr.open('POST',url,true);
		xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
		xhr.send(data);
	}

	xhr.onreadystatechange=function(){
		if(xhr.status==200&&xhr.readyState==4){
			success(xhr.responseText);
		}
	}
}